package com.lbb.waimai.controller;

import com.lbb.waimai.entiry.Category;
import com.lbb.waimai.result.R;
import com.lbb.waimai.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
@CrossOrigin
@RestController
@RequestMapping("/category")
public class CategoryController {

    @Autowired
    private CategoryService categoryService;

    @GetMapping("/findAll")
    public R findAll(){
//        List<Category> list = categoryService.getCategorylist();
        List<Category> list = categoryService.list();
        return R.ok().data("data",list);
    }

}
